A parallel I/O bus provides a peer-to-peer interface among a network of computers and peripheral devices, such as disk drives and CD-POM drives. One such parallel I/O bus, the Small Computer Standard Interface (SCSI), became an ANSI standard in 1986 under the title X3.131-1986. SCSI-1, the subject of this ANSI standard has been enhanced by the introduction of SCSI-2.
A SCSI system consists of one or more initiators, which are able to issue commands on the SCSI bus, and one or more targets, which perform commands received from an initiator. For example, an initiator could be a CPU of a computer system. This initiator might issue commands via the SCSI bus to a disk drive. The disk drive would be the target Activity by initiators and targets on the SCSI bus is accomplished by an eight-phase transaction cycle, consisting of the phases named: BUS FREE, ARBITRATION, SELECTION, RESELECTION, COMMAND, DATA, STATUS, and MESSAGE.
A SCSI bus cycle begins in the BUS FREE phase. In the ARBITRATION phase, the devices needing access to the bus vie to gain control it. The device with the highest SCSI ID is given control. Then in the SELECTION phase, an initiator which has been given control, chooses its target device. Alternatively, in the RESELECTION phase, a target which has been given control and which needs to reconnect to an initiator, chooses the initiator device.
The lag four phases (COMMAND, DATA, STATUS and MESSAGE) are collectively known as the information transfer phase. In the COMMAND phase, a target device requests a command from an initiator device. Data is transferred in the set of DATA phases. In the STATUS phase, a single status byte is sent by the target to the initiator. This status byte indicates whether or not the SCSI command has been successfully completed. In the final phase of a SCSI command, a "command complete" message is sent from the target to the initiator to indicate that the SCSI command has completed. Messages are also used by an initiator to indicate some abnormal event on the SCSI bus. An initiator may assert the ATN signal during SCSI information transfer phases to indicate a desire to send a SCSI message to the target. This may occur during any information transfer phase.
In some sequencer-based implementations of a SCSI system, once a message is received in the MESSAGE phase, a subroutine is called in order to provide further processing. The subroutine called is based upon the location of the sequencer instruction in the sequencer code area (hereafter referred to as sequencer instruction location) which was being executed when the ATN signal was detected and the message that was received by the target in response to the AIN signal. The subroutine calls can be implemented in various ways. One implementation used to decide which subroutine should be called involves a series of checks For example, nested IF-statements could branch to a subroutine based on the results of several compound IF-statements, such as:
______________________________________ IF SEQUENCER.sub.-- INSTRUCTION.sub.-- LOCATION.sub.-- 1 THEN IF MESSAGE.sub.-- 1 THEN GOSUB SUBROUTINE.sub.-- 1 ELSE IF MESSAGE.sub.-- 2 THEN GOSUB SUBROUTINE.sub.-- 2 ELSE IF MESSAGE.sub.-- 3 THEN GOSUB SUBROUTINE.sub.-- 3 END.sub.-- IF END.sub.-- IF ELSE IF SEQUENCER.sub.-- INSTRUCTION.sub.-- LOCATION.sub.-- 2 THEN IF MESSAGE.sub.-- 1 THEN GOSUB SUBROUTINE.sub.-- 4 ELSE IF MESSAGE.sub.-- 2 THEN GOSUB SUBROUTINE.sub.-- 5 END.sub.-- IF END.sub.-- IF ______________________________________
An alternative implementation of supporting these subroutine calls is by using a jump table. Jump tables are two dimensional arrays by which a jump to a subroutine is determined by the array's coordinates. In the preceding example, the x-coordinate of an array could correspond to the sequencer instruction location and the y-coordinate could represent the message. The contents of any element in the array, referenced by an x-axis sequencer instruction location and a y-axis message, is the appropriate subroutine call.
However, jump tables have disadvantages. A primary disadvantage is memory usage. A jump table whose dimensions are referenced by the set of sequencer instruction locations and the set of messages wastes memory if not all sequencer instruction locations are paired with messages, if not all messages are supported as valid messages, or if the actions to be taken for different messages is identical. In these situations, the jump table is a sparse table. The table entries which do not provide an address of a subroutine function are superfluous. What is needed in the art is a way to decrease the memory consumption of such a sparse jump table. The enhanced jump table should require a minimum amount of memory and yet offer ease of implementation without significant degradation in performance.